$(document).ready(function(){
	
	$("#pageSelection").bind("change",function(){
		$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/appropriationApprovementList.htm",{pageIndex:$("#pageSelection").val()});
	});
	
	$("#previousButton").bind("click",function(){
		$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/appropriationApprovementList.htm",{pageIndex:$("#previousPageIndex").val()});
	});
	
	$("#nextButton").bind("click",function(){
		$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/appropriationApprovementList.htm",{pageIndex:$("#nextPageIndex").val()});
	});
	
});


function approve(id){
	$("#operate_"+id).text("处理中...");
	$.post(getRootPath()+ "/MainMenu/fund/approveAppropriationApplication.htm",{"appropriationApplicationId":id},function(data){
		if(data.error){
			alert(data.error);
		}else{
			$("#operate_"+id).text("---已批准---");
		}
	});
}

function reject(id){
	$("#rejectReasonDiv").dialog("open");
	$("#applicationId").val(id);
}